/**
 * 能源库存管理
 */
import * as React from "react";
import AmountCardGrounp from "./compontents/AmountCardGrounp";
import ActionToolBar from "./compontents/ActionToolBar";
import AmountTable from "./compontents/AmountTable";
import "./index.less";

export interface EnergyInventoryManagementProps {}

export interface EnergyInventoryManagementState {}

class EnergyInventoryManagement extends React.Component<
  EnergyInventoryManagementProps,
  EnergyInventoryManagementState
> {
  protected type: string = "1";
  protected actionredom: number = Math.random();
  render() {
    return (
      <div className="EnergyInventoryManagement">
        <AmountCardGrounp />
        <ActionToolBar
          onChange={(type: string, action: boolean) => {
            this.ActionToolBarChange(type, action);
          }}
        />
        <AmountTable energyTypeId={this.type} action={this.actionredom} />
      </div>
    );
  }
  ActionToolBarChange(type: string, action: boolean) {
    this.type = type;
    if (action) {
      this.actionredom = Math.random();
    }
    this.forceUpdate();
  }
  componentDidMount() {}
}

export default EnergyInventoryManagement;
